$.fn.ygzcombobox = function () {
    this.zcombobox({
        //url: $.webPath() + '/sys/yg/ygxm_list',
        data: [
            {id: 1, xm: "张三"},
            {id: 2, xm: "李四"},
            {id: 3, xm: "王五"}
        ],
        param: "xm",
        valueField: "id",
        textField: "xm",
        keylength: 0,
        readonly:true,
        onSelect: function (data) {
            alert(data.id + "   " + data.xm);
        }
    });
}
/**
 * 企业机构查询
 */
$.fn.qyjgzcombobox = function () {
    var option = {
        url: $.webPath() + '/organ/qyjg/qyjgjc_list',
        param: "jc",
        valueField: "id",
        textField: "jc",
        keylength: 2,
        readonly:false,
        onSelect: function (data) {
            //alert(data.id + "   " + data.jc);
        }
    }
    this.zcombobox($.createArg(option,arguments))
}



/**
 * 质押方查询
 */
$.fn.zyfzcombobox = function () {
    var option = {
        url: $.webPath() + '/organ/zyf/zyfjc_list',
        param: "jc",
        valueField: "id",
        textField: "jc",
        keylength: 2,
        readonly:false,
        onSelect: function (data) {}
    }
    this.zcombobox($.createArg(option,arguments))
}

/**
 * 查询所有的内部公司和企业机构
 */
$.fn.gsjgzcombobox = function () {
    var option = {
        url: $.webPath() + '/organ/gsjg/gsjgandqyjg_list',
        param: "jc",
        valueField: "id",
        textField: "jc",
        keylength: 2,
        readonly:false,
        onSelect: function (data) {
            //alert(data.id + "   " + data.jc);
        }
    }
    this.zcombobox($.createArg(option,arguments))
}


$.fn.gsjgqczcombobox = function () {
    var option = {
        url: $.webPath() + '/organ/gsjg/gsjgandqyjg_qclist',
        param: "qc",
        valueField: "id",
        textField: "qc",
        keylength: 2,
        readonly:false,
        onSelect: function (data) {
            //alert(data.id + "   " + data.jc);
        }
    }
    this.zcombobox($.createArg(option,arguments))
}

$.fn.qyjgqczcombobox = function () {
    var option = {
        url: $.webPath() + '/organ/qyjg/qyjgqc_list',
        param: "jc",
        valueField: "id",
        textField: "qc",
        keylength: 2,
        readonly:false,
        onSelect: function (data) {
            //alert(data.id + "   " + data.jc);
        }
    }
    this.zcombobox($.createArg(option,arguments))
}

$.fn.czgsjgqczcombobox = function (param,data2) {
    var option = {
        url: $.webPath() + '/organ/gsjg/gsjgandqyjg_qclist',
        param: "qc",
        valueField: "id",
        textField: "qc",
        keylength: 2,
        readonly:false,
        onSelect: function (data) {
            var url = $.webPath() + "/organ/ejzh/findEjzhByKhId?nbgsId="+data2.combotree("getValue")+"&&khId="+  data.id;
            param.combobox("reload",url);
        }
    }
    this.zcombobox($.createArg(option,arguments))
}





$.fn.bzjgsjgqczcombobox = function (param,htId) {
    var option = {
        url: $.webPath() + '/organ/gsjg/findXyKhByHtId_qclist?htId='+htId,
        param: "qc",
        valueField: "id",
        textField: "qc",
        keylength: 2,
        readonly:false,
        onSelect: function (data) {
            var url = $.webPath() + "/organ/ejzh/findEjzhByKhId?khId="+  data.id;
            param.combobox("reload",url);
        }
    }
    this.zcombobox($.createArg(option,arguments))
}
$.fn.skczgsjgqczcombobox = function (param,p2) {
    var option = {
        url: $.webPath() + '/organ/gsjg/gsjgandqyjg_qclist',
        param: "qc",
        valueField: "id",
        textField: "qc",
        keylength: 2,
        readonly:false,
        onSelect: function (data) {
            var url = $.webPath() + "/organ/ejzh/findEjzhByKhAndNbgsId?khId="+  data.id+"&&nbgsId="+p2.val();
            param.combobox("reload",url);
        }
    }
    this.zcombobox($.createArg(option,arguments))
}


//    valueField: "value",             //下拉的value
//    textField: "text",               //下拉的text
//    keylength: 0,                    //多少位按回车查询
//    key: "",                         //key值
//    data: null,                      //上次取得的数据源
//    param: null,                     //参数名称
//    url: null,                       //数据源的url地址
//    onSuccess:function($target){},   //加载结束时
//    onSelect:function(data){}        //选择事件
//   id 选择器 .value();  id 选择器 .text()
//    onMap();